Skip to content

evaluation error: cannot determine bounds #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ptal opened this issue Apr 25, 2025 · 2 comments
Open

evaluation error: cannot determine bounds #917

ptal opened this issue Apr 25, 2025 · 2 comments

Comments

@ptal
Copy link

ptal commented Apr 25, 2025

In Minizinc 2.9.2, the following model gives an error during compilation:

var int: x;
var int: y;
var int: z;

constraint x = y / z;

constraint y = -4;
constraint x >= 0 /\ x <= 1;
constraint z = -5;
solve satisfy;
[Playground:6.12-20](err:/tmp/MiniZinc%20IDE%20(bundled)-konAZR/untitled_model.mzn?line=6&column=12)
  in binary '=' operator expression
  in binary '/' operator expression
[stdlib_math:251-3.257-7](err:/opt/minizinc-ide/share/minizinc/std/stdlib/stdlib_math.mzn?line=251&column=3)
  in if-then-else expression
[stdlib_math:252.5-17](err:/opt/minizinc-ide/share/minizinc/std/stdlib/stdlib_math.mzn?line=252&column=5)
  in call 'fldiv_t'
[stdlib_internal:2722-3.2726-8](err:/opt/minizinc-ide/share/minizinc/std/stdlib/stdlib_internal.mzn?line=2722&column=3)
  in let expression
[stdlib_internal:2723.5-61](err:/opt/minizinc-ide/share/minizinc/std/stdlib/stdlib_internal.mzn?line=2723&column=5)
  in variable declaration for 'z'
  in call 'compute_float_div_bounds'
  in call 'compute_float_div_bounds'
MiniZinc: evaluation error: cannot determine bounds
@ptal ptal changed the title Creation of float variables on int-only model Creation of float variables on integer model Apr 25, 2025
@zayenz
Copy link
Contributor

zayenz commented Apr 25, 2025

Note that / is the float division, div is the integer division operator. https://docs.minizinc.dev/en/stable/spec.html#arithmetic-operations

@ptal
Copy link
Author

ptal commented Apr 26, 2025

oh, it makes sense, I forgot there was a specific operator for integer division. Thanks for the info.

It solves the first part of the issue I guess.

@ptal ptal changed the title Creation of float variables on integer model evaluation error: cannot determine bounds Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants